
var gridDefsPrevios = {
	
    initDateEdit: function (elem) {
      //setTimeout(function() {
          $(elem).datepick({
              showOn: 'both', 
              dateFormat: 'dd-mm-yy',
              clearText: '', 
              clearStatus: '', 
              closeText: '', 
              autoSize: true,
              changeYear: true,
              changeMonth: true,
              showButtonPanel: true,
              showWeek: true,
              closeStatus: '', 
              buttonImageOnly: true, 
              buttonImage: 'Content/images/calendar-blue.gif'
          });
      //}, 100);
    },
    
    initDateSearch: function (elem) {
      //setTimeout(function() {
          $(elem).datepick({
              showOn: 'both', 
              dateFormat: 'dd-mm-yy',
              clearText: '', 
              clearStatus: '', 
              closeText: '', 
              autoSize: true,
              changeYear: true,
              changeMonth: true,
              showButtonPanel: true,
              showWeek: true,
              closeStatus: '', 
              buttonImageOnly: true, 
              buttonImage: 'Content/images/calendar-blue.gif'
          });
      //}, 100);
    }        
        
}


var gridDefinitions = {
	
    initDateEdit: gridDefsPrevios.initDateEdit,
    
    initDateSearch: gridDefsPrevios.initDateSearch,    
    
    dateTemplate: {width: 140, align: 'center', sorttype: 'date', formatter: 'date',
        	formatoptions: { srcformat:'ISO8601Long', newformat: 'd/m/Y' }, datefmt: 'd/m/Y', 
        	editoptions: { dataInit: gridDefsPrevios.initDateEdit },
          searchoptions: { sopt: ['eq', 'ne', 'lt', 'le', 'gt', 'ge'], dataInit: gridDefsPrevios.initDateSearch }
    },    
    
    numberTemplate: 
    {
    			formatter: 'number', align: 'right', sorttype: 'number',
            	searchoptions: { sopt: ['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'nu', 'nn', 'in', 'ni'] }
    },
        
    yesNoTemplate: 
    {
    			align: 'center', formatter: 'checkbox',
	        edittype: 'checkbox', editoptions: {value: 'Yes:No', defaultValue: 'Yes'},
	        stype: 'select', searchoptions: { sopt: ['eq', 'ne'], value: ':Any;true:Yes;false:No' }
    }    
        
}
